//
//  GroupModel.m
//  汽车品牌展示2
//
//  Created by 伍银荣 on 2021/6/3.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "GroupModel.h"
#import "CarsModel.h"

@implementation GroupModel

-(instancetype)initWithDictionary:(NSDictionary *)dict {
    if (self = [super init]) {
//        self.title = dict[@"title"];
//        self.cars = dict[@"cars"];
        [self setValuesForKeysWithDictionary:dict];
        NSMutableArray *mArr = [NSMutableArray array];
        for (NSDictionary *dict_item in dict[@"cars"]) {
            CarsModel *model = [CarsModel carsWithDictionary:dict_item];
            [mArr addObject:model];
        }
        self.cars = mArr;
    }
    return self;
}

+(instancetype)groupWithDictionary:(NSDictionary *)dict {
    return [[self alloc]initWithDictionary:dict];
}

@end
